package com.bs.jianli.util.exception;

import com.bs.jianli.util.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author 小姚
 * @pakeageName:com.bs.jianli.util.exception
 * @ClassName:MyException
 * @Descirption:
 * @data 2023/1/13 18:00
 */
@RestControllerAdvice
public class MyException {

    @ExceptionHandler(NotUserException.class)
    public Result noUser(NotUserException e){
        return Result.fail(e.getMessage());
    }


    @ExceptionHandler(NoPwdException.class)
    public Result nopwd(NoPwdException e){
        return Result.fail(e.getMessage());
    }


    @ExceptionHandler(NoAuthException.class)
    public Result noUser(NoAuthException e){
        return Result.fail(e.getMessage());
    }

    @ExceptionHandler(ServiceException.class)
    public Result noUser(ServiceException e){
        return Result.fail(e.getMessage());
    }


}
